package org.erepublik.company;

import java.util.HashMap;

public enum ESkill {
    ARCHITECT(6, "Architect", "architect.png"),
    PRODUCER(1, "Producer", "producer.png"),
    MARKETING_MANAGER(2, "Marketing Manger", "marketingmanager.png"),
    MECHANIC(8, "Mechanic", "mechanic.png"),
    FITTER(9, "Fitter", "fitter.png"),
    TECHNIC(10, "Technic", "technic.png"),
    ENGINEER(7, "Engineer", "engineer.png"),
    PROJECT_MANAGER(3 , "Project Manager", "projectmanager.png"),
    HARVESTER(11, "Harvester", "harvester.png"),
    CARPENTER(4, "Carpenter", "carpenter.png"),
    BUILDER(5, "Builder", "builder.png");

    private int id;
    private String name;
    private String img;
    
    public int getId() {
        return id;
    }
    public String getName() {
        return name;
    }
    public String getImg() {
        return img;
    }
    ESkill(int id, String name, String img) {
        this.id = id;
        this.name = name;
        this.img = img;
    }

    private static HashMap<Integer, ESkill> map = null;
    public static ESkill getSkillById(int skillId) {
        if (map == null)
            initMap();
        return map.get(skillId);
    }
    
    private static void initMap() {
        map = new HashMap<Integer, ESkill>();
        for (ESkill product : ESkill.values()) {
            map.put(product.getId(), product);
        }
    }
    
}
